public class FuzzyAdapter implements CrispVariableBox {
    private CrispVariableBox crispVariables;
    private FuzzySystem system;

    public FuzzyAdapter(CrispVariableBox box) {
        assert null != box : "Requre a valid CrispVariableBox";
        this.crispVariables = box;

        // defaults
        this.system = new FuzzySystem();
    }

    public double getInitialVelocity() {
        // TODO: Defuzzify values properly
        return crispVariables.getInitialVelocity();
    }
    public double getInitialDistance(int i) {
        // TODO: Defuzzify values properly
        return crispVariables.getInitialDistance(i);
    }

    public double getDesiredVelocity() {
        // TODO: Defuzzify values properly
        return crispVariables.getDesiredVelocity();
    }
    public double getDesiredDistance() {
        // TODO: Defuzzify values properly
        return crispVariables.getDesiredDistance();
    }

    public double calcAcceleration(double currentVelocity, double separationDistance) {
        // TODO: Fuzzify values
        // TODO: Provide value to fuzzy inference engine
        // TODO: Defuzzify values

        // TODO: remove this
        double acc = 0.0;
        if ( Math.abs( separationDistance ) < 5.0 ) {
          acc = 0.0;
        }
        else if ( separationDistance > 0 ) {
          acc = 2.0;
        }
        else {
          acc = -1.0;
        }

        return acc;
    }
}
